<template>
  <el-input :modelValue="userName" @update:modelValue="handleInput"></el-input>
  <el-button @click="handleSubmit" type="primary">提交</el-button>
</template>

<script setup>
import { ref, defineEmits } from 'vue'
const props = defineProps({
  modelValue: String,
  title: String
})
let userName = ref(props.modelValue)
const emit = defineEmits(['update:modelValue', 'submit'])

const handleInput = val => {
  userName.value = val
  emit('update:modelValue', val)
}

const handleSubmit = userName => {
  emit('submit', userName)
}


</script>

<style>

</style>